/* RESET */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #08213A;
}

/* EACH SCREEN */
#get-user,
#signIn,
#createAccount,
#main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* MAIN CHAT */
#main {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
    padding: 0;
    box-sizing: border-box;
    height: 100vh;
    overflow: hidden;
}

/* Chat Sidebar */
#chats-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    background-color: #0a2844;
    border-right: 2px solid #0fb3a5;
    box-sizing: border-box;
    height: 100vh;
    overflow: hidden;
}

#chats-header {
    padding: 15px;
    border-bottom: 2px solid #0fb3a5;
}

#chats-header h3 {
    margin: 0 0 10px 0;
    color: #0fb3a5;
    font-size: 18px;
}

#newChatButton {
    width: 100%;
    padding: 8px;
    background-color: #0fb3a5;
    color: #08213A;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

#newChatButton:hover {
    background-color: #00d9cc;
}

#chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-item {
    padding: 10px;
    margin: 5px 0;
    background-color: #1a3d5c;
    border-left: 3px solid #0fb3a5;
    cursor: pointer;
    border-radius: 5px;
    color: #e0e0e0;
    transition: all 0.2s ease;
}

.chat-item:hover {
    background-color: #2a5d7c;
}

.chat-item.active {
    background-color: #0fb3a5;
    color: #08213A;
    font-weight: bold;
}

/* Left / right columns inside main */
#left-column {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0; /* allow children to shrink */
    padding: 0 20px 10px 20px;
    box-sizing: border-box;
}

#right-column {
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    gap: 12px;
}

/* main-chat area within left-column should fill available height so input stays visible */
#main-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

/* CENTERED CONTENT */
#center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* WELCOME TEXT */
#welcome {
    font: 26px 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: rgb(15, 179, 165);
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* BUTTONS */
.gub {
    font: 24px Arial, sans-serif;
    color: #08213A;
    background-color: #0fb3a5;
    border: 3px solid #0fb3a5;
    border-radius: 10px;
    padding: 10px 15px;
    cursor: pointer;
    margin: 3px 20px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.gub:hover {
    background-color: #00d9cc;
}

/* BORDER WRAPPER */
.border-outline {
    display: inline-block;
    border: 5px solid black;
    border-radius: 30px;
    background-color: white;
    padding: 40px 30px;
    width: 320px;
    box-sizing: border-box;
}

/* INPUTS STYLING */
#createAccount input,
#signIn input {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 12px 15px;
    border: 2px solid #aaa;
    border-radius: 10px;
    font-size: 18px;
    box-sizing: border-box;
    background-color: white;
}

/* INPUT FOCUS EFFECT */
#createAccount input:focus,
#signIn input:focus {
    outline: none;
    border-color: black;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* FORM BUTTONS */
.form-button {
    display: block;
    width: 100%;
    margin: 8px 0;
    padding: 12px 15px;
    border: 2px solid #0fb3a5;
    border-radius: 10px;
    font-size: 16px;
    background-color: #0fb3a5;
    color: #08213A;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box;
}

.form-button:hover {
    background-color: #00d9cc;
}

.logo {
    border-radius: 12px;
    width: 160px;
    height: auto;
    margin: 0;
    display: block;
}

/* USER AVATAR */
.user-avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid #0fb3a5;
}

.user-avatar-container:hover {
    border-color: #00d9cc;
    box-shadow: 0 0 15px rgba(15, 179, 165, 0.5);
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0fb3a5, #1a4d48);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
}

button {
    transition: all 0.2s ease;
    background: blue;
}

/* MESSAGES CONTAINER */
#messages-container {
    width: 100%;
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    border: none;
    border-top: 2px solid #0fb3a5;
    border-bottom: 2px solid #0fb3a5;
    border-radius: 0;
    background-color: #0a2844;
    padding: 20px;
    box-sizing: border-box;
}

#messages-container::-webkit-scrollbar {
    width: 10px;
}

#messages-container::-webkit-scrollbar-track {
    background: transparent;
}

#messages-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

#messages-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* INDIVIDUAL MESSAGE */
.message {
    margin: 8px 0;
    padding: 10px;
    border-radius: 8px;
    background-color: #1a3d5c;
    border-left: 4px solid #0fb3a5;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0fb3a5;
    flex-shrink: 0;
}

.message-avatar.placeholder {
    background: linear-gradient(135deg, #0fb3a5, #1a4d48);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.message-sender {
    font-weight: bold;
    color: #0fb3a5;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-text {
    color: #e0e0e0;
    font-size: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* CONTEXT MENU */
.context-menu {
    position: fixed;
    background-color: #1a3d5c;
    border: 2px solid #0fb3a5;
    border-radius: 5px;
    z-index: 9999;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.context-menu-item {
    padding: 10px 15px;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.context-menu-item:hover {
    background-color: #0fb3a5;
    color: #08213A;
}

/* MEDIA IN MESSAGES */
.message-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
}

.message-video {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
    background-color: #0a2844;
}

.message-file {
    text-decoration: none;
}

.file-download {
    background-color: #0fb3a5;
    color: #08213A;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 8px 0;
    font-weight: bold;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-download:hover {
    background-color: #00d9cc;
}

/* INPUT AREA */
#input-area {
    width: 100%;
    margin: 0;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    box-sizing: border-box;
}

#attachButton {
    padding: 12px 15px;
    font-size: 18px;
    background-color: #0fb3a5;
    color: #08213A;
    border: 2px solid #0fb3a5;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

#attachButton:hover {
    background-color: #00d9cc;
}

#callButton, #videoCallButton {
    padding: 12px 12px;
    font-size: 16px;
    background-color: #0fb3a5;
    color: #08213A;
    border: 2px solid #0fb3a5;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

#callButton:hover, #videoCallButton:hover {
    background-color: #00d9cc;
}

#videoCallButton {
    display: none;
}

#messageInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #0fb3a5;
    border-radius: 10px;
    font-size: 16px;
    background-color: #1a3d5c;
    color: #e0e0e0;
}

#messageInput::placeholder {
    color: #888;
}

#messageInput:focus {
    outline: none;
    border-color: #00d9cc;
    box-shadow: 0 0 5px rgba(15, 179, 165, 0.3);
}

#sendButton {
    padding: 12px 40px;
    font-size: 16px;
    background-color: #0fb3a5;
    color: #08213A;
    border: 2px solid #0fb3a5;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

#sendButton:hover {
    background-color: #00d9cc;
}